import 'package:flutter/material.dart';
import 'package:jd_shopping/services/ScreenAdaper.dart';

class Order extends StatefulWidget {
  @override
  _OrderState createState() => _OrderState();
}

class _OrderState extends State<Order> {
  @override
  Widget build(BuildContext context) {
    ScreenAdaper.init(context);
    return Scaffold(
      appBar: AppBar(title: Text('我的订单')),
      body: ListView.builder(
          itemCount: 2,
          itemBuilder: (context, index) {
            return Card(
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: <Widget>[
                  Container(
                    margin: EdgeInsets.all(ScreenAdaper.height(50)),
                    child: Text('订单编号：5dgj76h67hbs88860kjhh'),
                  ),
                  Divider(height: 1),
                  Container(
                      child: Column(
                    children: <Widget>[
                      Container(
                        child: Row(
                          children: <Widget>[
                            Expanded(
                                flex: 3,
                                child: Image.network(
                                  'http://jd.itying.com/public/upload/RinsvExKu7Ed-ocs_7W1DxYO.png_200x200.png',
                                  fit: BoxFit.cover,
                                )),
                            Expanded(flex: 5, child: Text('磨砂牛皮男休闲鞋-有属性')),
                            Expanded(flex: 1, child: Text('x1')),
                          ],
                        ),
                      ),
                      Positioned(
                        bottom: 0,
                        height: ScreenAdaper.height(80),
                        child: Container(
                          height: ScreenAdaper.height(80),
                          child: Stack(
                            children: <Widget>[
                              Container(
                                 margin: EdgeInsets.fromLTRB(20, 0, 0, 0),
                                child: Align(
                                  alignment: Alignment.centerLeft,
                                  child: Row(
                                    children: <Widget>[
                                      Text("合计:"),
                                      Text(
                                        '￥11',
                                        style: TextStyle(
                                            color: Colors.red, fontSize: 20),
                                      ),
                                    ],
                                  ),
                                ),
                              ),
                              Container(
                                  margin:
                                   EdgeInsets.fromLTRB(0, 0, 20, 0),
                                  child: Align(
                                alignment: Alignment.centerRight,
                                child: RaisedButton(
                                  child: Text('申请售后',
                                      style: TextStyle(color: Colors.black87)),
                                  color: Colors.grey[300],
                                  onPressed: () {
                                  
                                  },
                                ),
                              )),
                            ],
                          ),
                        ),
                      ),
                    ],
                  ))
                ],
              ),
            );
          }),
    );
  }
}
